<include file="Public:pagerForm"/>
<div class="pageHeader">
    <form rel="pagerForm" onsubmit="return navTabSearch(this);" action="__CONTROLLER__/drawIndex" method="post">
	<div class="searchBar">		
            <table class="searchContent">
                <tr>
                    <td>
                        用户名：<input type="text" name="user"  value="<{$Think.post.user}>"/>
                    </td>
                    <td>
                        获奖时间：<input type="text" class="date" readonly="true" name="add_time"  value="<{$Think.post.add_time}>"/>
                    </td>
                    <td>
                        派奖人：<input type="text" name="is_go_user"  value="<{$Think.post.is_go_user}>"/>
                    </td>
                    <td>
                        奖品名称：<input type="text" name="draw"  value="<{$Think.post.draw}>"/>
                    </td>
                </tr>
            </table>
            <div class="subBar">
                <ul>
                    <li><div class="buttonActive"><div class="buttonContent"><button type="submit">检索</button></div></div></li>
                </ul>
            </div>
	</div>
    </form>
</div>
<div class="pageContent">   
    <eq name='Think.session.role_id' value='2'>
        <div class="panelBar">
            <ul class="toolBar"> 
                <li><a title="确实要删除这些记录吗?" target="selectedTodo" rel="id[]" href="<{:U('Draw/delete',array('db'=>code('DrawData',1)))}>" class="delete"><span>批量删除</span></a></li> 
                <li class="line">line</li>
            </ul>
        </div>
        <table class="table" width="70%" layoutH="138">
    <else/>
        <table class="table" width="70%" layoutH="110">
    </eq>   
        <thead>
            <tr>
                <eq name='Think.session.role_id' value='2'>
                    <th width="22">
                        <input type="checkbox" group="id[]" class="checkboxCtrl">
                    </th>
                </eq>
                <th width="30"  align="center">序号</th>
                <th width="100" align="center">获奖人</th>
                <th width="100" orderField='draw_grade' <if condition="$_REQUEST['_order'] eq 'draw_grade'">class="<{$_REQUEST._sort}>"</if> align="center">获奖等级</th>
                <th width="90" orderField='add_time' <if condition="$_REQUEST['_order'] eq 'add_time'">class="<{$_REQUEST._sort}>"</if> align="center" >获奖时间</th>            
                <th width="80" align="center">是否已派奖</th>
                <th width="60" align="center">派奖人</th>
                <th width="110" align="center">派奖时间</th>
                <th width="100" align="center">操作</th>
            </tr>
        </thead>
        <tbody>
            <foreach name='list' item="list">
                <tr target="l_id" rel="<{$list.id}>"> 
                    <eq name='Think.session.role_id' value='2'>
                        <td>
                            <input name="id[]" value="<{$list.id}>" type="checkbox">
                        </td>
                    </eq>
                    <td><{$key+1}></td>
                    <td><{$list.user_id|getUsername}></td>
                    <td>
                        <switch name="list['draw_grade']">
                            <case value='1'><div style="color: green">一等奖</div></case>
                            <case value='2'><div style="color: blue">二等奖</div></case>
                            <case value='3'><div style="color: #ff00ff">三等奖</div></case>
                        </switch>
                    </td>
                    <td><{$list.add_time|substr=0,10}></td>
                    <td>
                        <eq name="list['is_go']" value='1'>
                            <div style="color:green">是</div>
                        <else/>
                        <div style="color:red">未派奖</div>
                        </eq>
                    </td>
                   <td>
                        <neq name="list['is_go_userid']" value=''>
                            <{$list.is_go_userid|getUsername}>
                        <else/>
                            <div style="color:red">未派奖</div>
                        </neq>
                    </td>
                    <td>
                        <neq name="list['is_go_time']" value=''>
                            <{$list.is_go_time|date="Y-m-d H:i",###}>
                        <else/>
                            <div style="color:red">未派奖</div>
                        </neq>
                    </td>
                    <td>                        
                        <neq name="list['is_go']" value='0'>
                            已派奖
                        <else/>
                            <a title="确定为该幸运用户派奖" target="ajaxTodo" href="<{:U('Draw/is_go',array('id'=>code($list['id'],1)))}>" style="color:green">派奖</a>
                        </neq>
                    </td>
                </tr>
            </foreach>
        </tbody>        
    </table>
    <div class="panelBar">
        <div class="pages">
            <span>显示</span>
            <select class="combox" name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value})">
                <option value="20">20</option>
                <option value="50">50</option>
                <option value="100">100</option>
                <option value="200">200</option>
            </select>
            <span>条，共<{$totalCount}>条</span>          
        </div>
        <div class="pagination" targetType="navTab" totalCount="<{$totalCount}>" numPerPage="<{$numPerPage}>" pageNumShown="6"  currentPage="<{$currentPage}>"></div>
    </div>
</div><style type="text/css" media="screen">
    .imgs div{height:100px!important;}
</style>
